@section('title') @parent 商品规格 @stop
@section('page_title')@parent
商品规格
@show

@section('content')


<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">{{ $spec->name }} - 规格选项</h3>
                <button class="btn btn-primary pull-right" type="button" onclick="location.href='{{ route('admin.product_spec.option.add', array('id'=>$spec->id)) }}'"><i class="fa fa-plus"></i>添加选项</button>
            </div><!-- /.box-header -->
            <div class="box-body table-responsive">
                <table id="example2" class="table table-bordered table-hover">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>名称</th>
                            <th>类型</th>
                            <th>默认值</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    @foreach($spec->options as $row)
                        <tr>
                            <td>{{ $row->id }}</td>
                            <td>{{ $row->name }}</td>
                            <td>{{ $row->value }}</td>
                            <td>{{ $row->sort }}</td>
                            <td>
                            	<a href="{{ route('admin.product_spec.option.edit', array('id'=>$spec->id,'option'=>$row->id)) }}" class="btn">修改</a> 
                            	<a href="{{ route('admin.product_spec.option.drop', array('id'=>$spec->id,'option'=>$row->id)) }}" class="btn">删除</a>
                            </td>
                        </tr>
                     @endforeach
                    </tbody>
                    <!-- tfoot>
                        <tr>
                            <th>Rendering engine</th>
                            <th>Browser</th>
                            <th>Platform(s)</th>
                            <th>Engine version</th>
                            <th>CSS grade</th>
                        </tr>
                    </tfoot -->
                </table>
            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </div>
</div>
<script type="text/javascript">
$(document).ready(function() {
    $('#example2').dataTable({
        "bPaginate": true,
        "bLengthChange": false,
        "bFilter": false,
        "bSort": true,
        "bInfo": true,
        "bAutoWidth": false
    });
});
</script>
@stop